/*
 * ADUIntroductionScene.cpp
 *
 *  Created on: Apr 11, 2014
 *      Author: 01nvchuong
 */

#include "ADUIntroductionScene.h"
#include "Constants.h"
#include "CGameManager.h"

using namespace cocos2d;

CCScene* ADUIntroductionLayer::scene()
{
	CCScene *scene = CCScene::create();

	ADUIntroductionLayer *layer = ADUIntroductionLayer::create();

	scene->addChild(layer);

	return scene;
}


bool ADUIntroductionLayer::init()
{

	if (!CCLayer::init()) {
		return false;
	}

	CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();

	CCSprite* bgSprite = CCSprite::create(INTRODUCTION_SCENE);
	bgSprite->setPosition(ccp(visibleSize.width / 2, visibleSize.height / 2));
	this->addChild(bgSprite, indexBackground);

	this->scheduleOnce(schedule_selector(ADUIntroductionLayer::onFinish), 1.5f);
	return true;
}

void ADUIntroductionLayer::onFinish()
{
	CCLog("onFinish() - ADUIntroductionLayer");
	CGameManager::Instance()->RunScene(SCENE_SPLASH);
}
